<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/util_file/common_basics.jspf"%>
<%@ include file="/WEB-INF/util_file/smartEditor.jspf"%>
<script type="text/javascript">
	//Smart Edito 등록
	var oEditors = [];
	nhn.husky.EZCreator.createInIFrame({
	oAppRef: oEditors,
	elPlaceHolder: "content",
	sSkinURI: "/jeons/se/SEditorSkin.html",
	fCreator: "createSEditorInIFrame"
	});  
	
	$("[name=open]").click( function(){
		check_result = $(this).val('value');
		$(this).siblings().removeAttr("checked");
	});
	
	$("#BtnSubmit").click( function(){
		oEditors.getById["content"].exec("UPDATE_IR_FIELD",[]);//Smart Editors
		var obj = $("#qna").serialize();
		$.post('/jeons/buildqna/insert',obj,function(data){
			location.reload();
			
		});
	});
	
	//리스트 가기
	$("#Btnlist").click( function(){
	 $.get('/jeons/buildqna/index',function(data){
			$("#subpage_qna").replaceWith(data);
		}); 
	});
	
</script>
<div id="subpage_qna">
<form:form commandName="qna" method="post">
<form:input path="qnano" value="${qnano}"/>
<form:input path="bdno" value="${bdno}"/>
<form:input path="bdtype" value="${bdtype}"/>
<form:input path="status" valeus="waiting"/>
<table border="0" width="650px" height="50">
	<tr>
		<td colspan="4" bgcolor="#000000" height="1"></td>
	</tr>
	<tr>
		<th height="24" align="center">제목</th>
		<td colspan="3"><form:input path="title"/></td>
	</tr>
	<tr>
		<td colspan="4" bgcolor="#ffffff" height="1"></td>
	</tr>
	<tr>
		<th height="24" align="center">유저아이디</th>
		<td colspan="3"><form:input path="u_id" /></td>
	</tr>
	<tr>
		<td colspan="4" bgcolor="#ffffff" height="1"></td>
	</tr>
	<tr>
		<th height="24" align="center">패스워드</th>
		<td colspan="3"><form:password path="passwd" /></td>
	</tr>
	<tr>
		<td colspan="4" bgcolor="#ffffff" height="1"></td>
	</tr>
	<tr>
		<th height="24" align="center">공개여부</th>
		<td colspan="3">
			<form:checkbox path="open" value="2"/>비공개
		</td>
	</tr>
	<tr>
		<td colspan="4" bgcolor="#ffffff" height="1"></td>
	</tr>
	<tr>
		<th colspan="4" height="4" align="center">내용</th>
	</tr>
	<tr>
		<td colspan="4" bgcolor="#ffffff" height="1"></td>
	</tr>
	<tr>
		<td colspan="4" bgcolor="#ffffff" height="1">
			<form:textarea path="content" name="content" cols="75" rows="20" cssStyle="overflow-x:hidden"></form:textarea>
		</td>
	</tr>
	<tr>
	<tr>
		<td colspan="4" bgcolor="#000000" height="1"></td>
	</tr>
</table>
<div align="right">
	<button type="button" id="BtnSubmit">확인</button>
	<button type="button" id="Btnlist">리스트</button>
</div>	
</form:form>
</div>